<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			body{
				margin: 0 auto;
				padding: 0;
			}
			a{
				text-decoration: none;
			}
		</style>
	</head>
	<body>
		<a class="tb" href="#">淘宝</a>
		<a class="jd" href="#">京东</a>
		<a class="pdd"id="pdd" name="pdd" href="#">拼多多</a>
		<a class="py" href="#">java培优</a>
		<script type="text/javascript">
			console.log(document.getElementsByTagName("a")[0].innerText)
			console.log(document.getElementsByTagName("a")[0].href)
			
			console.log(document.getElementsByClassName("pdd")[0].innerText)
			console.log(document.getElementsByClassName("pdd")[0].href)
			
			console.log(document.getElementsByName("pdd")[0].innerText)
			
			console.log(document.getElementById("pdd").innerText)
			var a = document.getElementsByTagName("a")[0]
			alert(a.innerText="bd")
			alert(a.innerText)
		</script>
	</body>
</html>
